package com.hnkywl.sts.entity.base;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.sys.Yg;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-5-20
 * Time: 下午8:39
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="T_SYS_DXPZ")
@Where(clause = "deleted!='1'")
public class Dxpz extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqDxpz", allocationSize = 1, sequenceName = "SEQ_SYS_DXPZ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqDxpz")
    private Long id;

    /**
     * 编码
     */
    private String dxbm;
    /**
     * 名称
     */
    private String mc;

    /**
     * 短信模版
     */
    private String dxmb;

    /**
     * 是否启用
     */
    private Boolean sfqy = false;

    /**
     * 发送人
     */
    @OneToMany(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinTable(name ="T_SYS_DXPZ_YG",joinColumns={@JoinColumn(name="DXPZ_ID")},inverseJoinColumns={@JoinColumn(name="YG_ID")})
    private List<Yg> fsrList;

    /**
     * 备注
     */
    private String bz;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDxbm() {
        return dxbm;
    }

    public void setDxbm(String dxbm) {
        this.dxbm = dxbm;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getDxmb() {
        return dxmb;
    }

    public void setDxmb(String dxmb) {
        this.dxmb = dxmb;
    }

    public Boolean getSfqy() {
        return sfqy;
    }

    public void setSfqy(Boolean sfqy) {
        this.sfqy = sfqy;
    }

    public List<Yg> getFsrList() {
        return fsrList;
    }

    public void setFsrList(List<Yg> fsrList) {
        this.fsrList = fsrList;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }
}
